package order.service.impl;

import common.model.result.Result;
import common.model.result.ResultCodeEnum;
import order.service.CartServiceFeignClient;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceFeignClientFallbackFallback implements CartServiceFeignClient {
    @Override
    public Result subCartlist(Long uid, List<String> cartIds) {
        String errorMsg = String.format("购物车服务异常 - 获取购物车列表失败 [用户ID: %d, 购物车IDs: %s]", 
            uid, cartIds != null ? cartIds.toString() : "null");
        return Result.failure(ResultCodeEnum.SERVER_ERROR, errorMsg);
    }

    @Override
    public Result deleteCartlist(Long uid, List<String> cartIds) {
        String errorMsg = String.format("购物车服务异常 - 删除购物车列表失败 [用户ID: %d, 购物车IDs: %s]", 
            uid, cartIds != null ? cartIds.toString() : "null");
        return Result.failure(ResultCodeEnum.FAIL, errorMsg);
    }
}
